<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="tip">支付成功，10s后跳转到新页面……</div>
<div>
    <input type="button" value="直接跳转" onclick="quickJump()">
    <input type="button" value="取消跳转" onclick="cancelJump()">
</div>
<script>
    var tipObj = document.getElementById("tip");
    var countdownNumber = 10;
    var countdownTip = window.setInterval(countdown, 1000);
    var jump = window.setTimeout(quickJump, countdownNumber * 1000);

    function quickJump() {
        window.open("https://wwww.baidu.com", "_self");
    }

    function cancelJump() {
        window.clearTimeout(jump);
        window.clearInterval(countdownTip);
    }

    function countdown() {
        tipObj.innerText = "支付成功，" + --countdownNumber + "s后跳转到新页面……";
    }
</script>
</body>
</html>